﻿using System;
using System.ComponentModel;
using System.Xml.Serialization;

namespace Microsoft.WowAddonStudio.FrameXml.Serialization.LayoutFrames
{
    [Serializable]
    [DesignerCategory("code")]
    [XmlType(Namespace = "http://www.blizzard.com/wow/ui/")]
    [XmlRoot(Namespace = "http://www.blizzard.com/wow/ui/", IsNullable = false)]
    public class ColorSelect : Frame
    {
        /// <summary>
        /// Gets or sets the texture of the color wheel.
        /// </summary>
        [XmlElement]
        [Category("Appearance")]
        public Texture ColorWheelTexture
        {
            get { return Properties.GetValue<Texture>("ColorWheelTexture"); }
            set { Properties.SetValue("ColorWheelTexture", value); }
        }

        /// <summary>
        /// Gets or sets the texture of the thumb of the color wheel.
        /// </summary>
        [XmlElement]
        [Category("Appearance")]
        public Texture ColorWheelThumbTexture
        {
            get { return Properties.GetValue<Texture>("ColorWheelThumbTexture"); }
            set { Properties.SetValue("ColorWheelThumbTexture", value); }
        }

        /// <summary>
        /// Gets or sets the texture of the color value.
        /// </summary>
        [XmlElement]
        [Category("Appearance")]
        public Texture ColorValueTexture
        {
            get { return Properties.GetValue<Texture>("ColorValueTexture"); }
            set { Properties.SetValue("ColorValueTexture", value); }
        }

        /// <summary>
        /// Gets or sets the texture of the thumb of the color value.
        /// </summary>
        [XmlElement]
        [Category("Appearance")]
        public Texture ColorValueThumbTexture
        {
            get { return Properties.GetValue<Texture>("ColorValueThumbTexture"); }
            set { Properties.SetValue("ColorValueThumbTexture", value); }
        }

        /// <summary>
        /// Gets a value indicating whether a serialization object is complete and can be rendered.
        /// </summary>
        public override bool IsComplete
        {
            get
            {
                return ColorWheelTexture != null || Backdrop != null;
            }
        }
    }
}